home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swags_z.zip / SCROLL.SWG / 0001_SCROLL1.PAS.pas next >
Pascal/Delphi Source File  |  1993-05-28  |  2KB  |  80 lines

  1. {
  2. >It's just a Fileviewer, I'm working on. I just want to be able to
  3. >scroll the File up, down, etc.
  4. }
  5.  
  6. Program ScrollDemo;
  7. Uses
  8.   Crt;
  9. Type
  10.   UpDown = (Up, Down);
  11.   { Scroll Text screen up or down. }
  12.  
  13. Procedure Scroll({input } Direction : UpDown;
  14.                           Lines2Scroll,
  15.                           Rowtop,
  16.                           RowBot,
  17.                           ColStart,
  18.                           ColStop,
  19.                           FillAttr : Byte);
  20. begin
  21.   if (Direction = Up) then
  22.   Asm
  23.     mov ah, 06h
  24.     mov al, Lines2Scroll
  25.     mov bh, FillAttr
  26.     mov ch, Rowtop
  27.     mov cl, ColStart
  28.     mov dh, RowBot
  29.     mov dl, ColStop
  30.     int 10h
  31.   end
  32.   else
  33.   Asm
  34.     mov ah, 07h
  35.     mov al, Lines2Scroll
  36.     mov bh, FillAttr
  37.     mov ch, Rowtop
  38.     mov cl, ColStart
  39.     mov dh, RowBot
  40.     mov dl, ColStop
  41.     int 10h
  42.   end
  43. end; { Scroll }
  44.  
  45. { Pause For a key press. }
  46. Procedure Pause;
  47. Var
  48.   chTemp : Char;
  49. begin
  50.   While KeyPressed do
  51.     chTemp := ReadKey;
  52.   Repeat Until(KeyPressed)
  53. end; { Pause }
  54.  
  55. Var
  56.   Index : Byte;
  57.   stTemp : String[80];
  58. begin
  59.   ClrScr;
  60.   { Display 24 lines of Text. }
  61.   For Index := 1 to 24 do
  62.     begin
  63.       stTemp[0] := #80;
  64.       fillChar(stTemp[1], length(stTemp), (Index + 64));
  65.       Write(stTemp)
  66.     end;
  67.   { Pause For a key press. }
  68.   Pause;
  69.   { Scroll Text down by 1 line. Use the Crt's Textattr }
  70.   { Variable as the Text color to fill with. }
  71.   Scroll(Down, 1, 0, 24, 0, 79, Textattr);
  72.   { Pause For a key press. }
  73.   Pause;
  74.   { Scroll Text up by 1 line. Use the Crt's Textattr }
  75.   { Variable as the Text color to fill with. }
  76.   Scroll(Up, 1, 0, 24, 0, 79, Textattr);
  77.   { Pause For a key press. }
  78.   Pause
  79. end.
  80.